<html>
<head>
    <meta charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <style>
        h1 { color: black; font-weight: bold; text-decoration: none; font-size: 14pt; }
        .s1 { font-style: normal; font-weight: bold; text-decoration: none; font-size: 10pt; }
        .p, p{ color: black;  font-style: normal; font-weight: normal; text-decoration: none; font-size: 13px;}
        .tb1 td{
            height: 25px;
            line-height: 25px;
            vertical-align: middle;
        }
        .tb4 td{
            height: 25px;
            vertical-align: middle;
        }
        .tb3 tr{
            height: 25px;
        }
        .tb2 {
            height: 30px;
            line-height: 30px
        }
        .input {
        }
        .tt1 {
            margin-bottom: 1px;
        }
    </style>
</head>
<?php
$contractName = '';
$disposal = false;
$transportation = false;
$transportationFisposal = false;
$ContractType = $contractReadyInfo[0]['contract_classification_type_master_id'];
if ($ContractType == '10209'){
    $contractName = '収 集 運 搬 用';
    $transportation = true;
} else if ($ContractType == '10210') {
    $contractName = '処 分 用';
    $disposal = true;
} else if ($ContractType == '10211') {
    $contractName = '収 集 運 搬 及 び 処 分 用';
    $transportationFisposal = true;
}
?>
<h2 style="text-align: center;"><b>［{{$contractName}}］</b></h2>
<h1 style="text-align: center;" class="input"><b>{{$contractReadyInfo[0]['contract_Kind_Name']}}</b></h1>
<div class="s1" style="text-align: right">
    <span class="input">{{$contractDate['year']}}</span>年
    <span class="s1"><span class="input">{{$contractDate['month']}}</span>月</span>
    <span class="s1"><span class="input">{{$contractDate['day']}}</span>日</span>
</div>
<div>
    <table>
        <tr>
            <td colspan="24" style="text-align: left">排出事業者（甲）</td>
        </tr>
        <tr>
            <td></td>
        </tr>
        <tr style="">
            <td colspan="3" style="text-align: right">住 所:</td>
            <td colspan="21"> {{$CwContract['PartyA_addr']}}</td>
        </tr>
        <tr>
            <td></td>
        </tr>
        <tr style="">
            <td colspan="3" style="text-align: right">氏 名:</td>
            <td colspan="21"> {{$CwContract['PartyA_corporate_organization_name']}}&nbsp;&nbsp;{{$CwContract['PartyA_representative_job']}}&nbsp;&nbsp;{{$CwContract['PartyA_representative_name']}}</td>
        </tr>
        <tr>
            <td></td>
        </tr>
        <tr>
            <td colspan="12" style="text-align: right">（法人にあっては名称及び代表者の氏名）</td>
            <td colspan="12"></td>
        </tr>
        <tr>
            <td></td>
        </tr>
        @if($disposal)
            <tr>
                <td colspan="24" style="text-align: left">処分業者（丙）</td>
            </tr>
            <tr>
                <td></td>
            </tr>
            <tr style="">
                <td colspan="3" style="text-align: right">住 所:</td>
                <td colspan="21" class="input"> {{$CwContract['PartyC_addr']}}</td>
            </tr>
            <tr>
                <td></td>
            </tr>
            <tr style="">
                <td colspan="3" style="text-align: right">氏 名:</td>
                <td colspan="21" class="input"> {{$CwContract['PartyC_corporate_organization_name']}}&nbsp;&nbsp;{{$CwContract['PartyC_representative_job']}}&nbsp;&nbsp;{{$CwContract['PartyC_representative_name']}}</td>
            </tr>
            <tr>
                <td></td>
            </tr>
            <tr>
                <td colspan="12" style="text-align: right">（法人にあっては名称及び代表者の氏名）</td>
                <td colspan="12"></td>
            </tr>
        @else
            <tr>
                <td colspan="24" style="text-align: left">収集運搬業者（乙）</td>
            </tr>
            <tr>
                <td></td>
            </tr>
            <tr style="">
                <td colspan="3" style="text-align: right">住 所:</td>
                <td colspan="21" class="input"> {{$CwContract['PartyB_addr']}}</td>
            </tr>
            <tr>
                <td></td>
            </tr>
            <tr style="">
                <td colspan="3" style="text-align: right">氏 名:</td>
                <td colspan="21" class="input"> {{$CwContract['PartyB_corporate_organization_name']}}&nbsp;&nbsp;{{$CwContract['PartyB_representative_job']}}&nbsp;&nbsp;{{$CwContract['PartyB_representative_name']}}</td>
            </tr>
            <tr>
                <td></td>
            </tr>
            <tr>
                <td colspan="12" style="text-align: right">（法人にあっては名称及び代表者の氏名）</td>
                <td colspan="12"></td>
            </tr>
        @endif
        @if($transportationFisposal)
            <tr>
                <td></td>
            </tr>
            <tr>
                <td colspan="24" style="text-align: left">処分業者（丙）</td>
            </tr>
            <tr>
                <td></td>
            </tr>
            <tr style="">
                <td colspan="3" style="text-align: right">住 所:</td>
                <td colspan="21"> {{$CwContract['PartyC_addr']}}</td>
            </tr>
            <tr>
                <td></td>
            </tr>
            <tr style="">
                <td colspan="3" style="text-align: right">氏 名:</td>
                <td colspan="21"> {{$CwContract['PartyC_corporate_organization_name']}}&nbsp;&nbsp;{{$CwContract['PartyC_representative_job']}}&nbsp;&nbsp;{{$CwContract['PartyC_representative_name']}}</td>
            </tr>
            <tr>
                <td></td>
            </tr>
            <tr>
                <td colspan="12" style="text-align: right">（法人にあっては名称及び代表者の氏名）</td>
                <td colspan="12"></td>
            </tr>
        @endif
    </table>
</div>
<div>
    <?php
    if (!empty($contract_text)){
        $d = $contract_text;
        $e = '';
        for ($m=0;$m<strlen($d);$m++){
            $f = $d[$m];
            if ($f == "\n") {
                $e = $e.'<br/>';
            } else if ($f == " "){
                $e = $e.'&nbsp;';
            }else{
                $e .= $f;
            }
        }
        echo ' <table cellspacing="0">
                        <tr>
                            <td class="input">'.$e.'</td>
                        </tr>
                    </table>
                  ';
    }
    ?>
</div>
<div style="color: black">
    <?php
    if (empty($contractReadyInfo[0]['additional_terms'])){
        echo '<br pagebreak="true" />';
    } else {
        $a = $contractReadyInfo[0]['additional_terms'];
        $c = '';
        for ($m=0;$m<strlen($a);$m++){
            $b = $a[$m];
            if ($b == "\n") {
                $c = $c.'<br/>';
            } else if ($b == " "){
                $c = $c.'&nbsp;';
            }else{
                $c .= $b;
            }
        }
        echo '<br pagebreak="true" />
                   <div style="color: black">追加条文、付則等</div>
                    <table cellspacing="0" border="1px">
                        <tr>
                            <td class="input">'.$c.'</td>
                        </tr>
                    </table>
                   <br pagebreak="true" />';
    }
    ?>
</div>
<br/>
<div class="tt1">別表１&nbsp;&nbsp;&nbsp;&nbsp;@if(!empty($table_title1))({{$table_title1}})@endif</div>
@if($disposal)
    <table cellspacing="0" border="1px" class="tb1">
        <tr style="text-align: center;background-color: #cccccc">
            <td  colspan="8" align="center"><span>処分</span></td>
        </tr>
        <tr>
            <td  colspan="3" width="30%"> <span>許可番号</span> </td>
            <td  colspan="5" width="70%"> <span class="input">{{sizeof($CwPartyCLinkLicense->toArray()) > 0 ? $CwPartyCLinkLicense[0]->Permission_number : ''}}</span></td>
        </tr>
        <tr>
            <td  colspan="3"> <span>許可都道府県・政令市</span> </td>
            <td  colspan="5"> <span class="input">{{sizeof($CwPartyCLinkLicense->toArray()) > 0 ? $CwPartyCLinkLicense[0]->Permission_addr : ''}}</span></td>
        </tr>
        <tr>
            <td  colspan="3"> 許可の有効期限 </td>
            <td  colspan="5"> <span class="input"><?php
                    if (sizeof($CwPartyCLinkLicense->toArray()) > 0) {
                        if(!empty($CwPartyCLinkLicense[0]->Expiration_date)) {
                            echo substr($CwPartyCLinkLicense[0]->Expiration_date,0,10);
                        }
                    }
                    ?></span></td>
        </tr>
        <tr>
            <td  colspan="3"> 事業区分 </td>
            <td  colspan="5"> <span class="input">{{sizeof($CwPartyCLinkLicense->toArray()) > 0 ? $CwPartyCLinkLicense[0]->Permission_bussion : ''}}</span></td>
        </tr>
        <tr>
            <td  colspan="3"> 産業廃棄物の種類 </td>
            <td  colspan="5"> <span class="input">{{sizeof($CwPartyCLinkLicense->toArray()) > 0 ? $CwPartyCLinkLicense[0]->Permission_type : ''}}</span></td>
        </tr>
        <tr>
            <td  colspan="3"> 許可の条件 </td>
            <td  colspan="5"> <span class="input">{{sizeof($CwPartyCLinkLicense->toArray()) > 0 ? $CwPartyCLinkLicense[0]->Permission_condition : ''}}</span></td>
        </tr>
    </table>
@else
    <table cellspacing="0" border="1px" class="tb1">
        <tr style="text-align: center;background-color: #cccccc">
            <td  colspan="8" align="center"><span>積込み場所</span></td>
        </tr>
        <tr>
            <td  colspan="3" width="30%"> <span>許可番号</span> </td>
            <td  colspan="5" width="70%"> <span class="input">{{$BLoadingPosition['Permission_number']}}</span></td>
        </tr>
        <tr>
            <td  colspan="3"> <span>許可都道府県・政令市</span> </td>
            <td  colspan="5"> <span class="input">{{$BLoadingPosition['Permission_addr']}}</span></td>
        </tr>
        <tr>
            <td  colspan="3"> 許可の有効期限 </td>
            <td  colspan="5"> <span class="input"><?php
                    if(!empty($BLoadingPosition['Expiration_date'])) {
                        echo substr($BLoadingPosition['Expiration_date'], 0, 10);
                    }?></span></td>
        </tr>
        <tr>
            <td  colspan="3"> 事業区分 </td>
            <td  colspan="5"> <span class="input">{{$BLoadingPosition['Permission_bussion']}}</span></td>
        </tr>
        <tr>
            <td  colspan="3"> 産業廃棄物の種類 </td>
            <td  colspan="5"> <span class="input">{{$BLoadingPosition['Permission_type']}}</span></td>
        </tr>
        <tr>
            <td  colspan="3"> 許可の条件 </td>
            <td  colspan="5"> <span class="input">{{$BLoadingPosition['Permission_condition']}}</span></td>
        </tr>
    </table>
    <table cellspacing="0" border="1px" class="tb1">
        <tr style="text-align: center;background-color: #cccccc">
            <td  colspan="8" align="center"><span>荷下ろし場所</span></td>
        </tr>
        <tr>
            <td  colspan="3" width="30%"> <span>許可番号</span> </td>
            <td  colspan="5" width="70%"> <span class="input">{{$BUnloadingPosition['Permission_number']}}</span></td>
        </tr>
        <tr>
            <td  colspan="3"> <span>許可都道府県・政令市</span> </td>
            <td  colspan="5"> <span class="input">{{$BUnloadingPosition['Permission_addr']}}</span></td>
        </tr>
        <tr>
            <td  colspan="3"> 許可の有効期限 </td>
            <td  colspan="5"> <span class="input"><?php
                    if(!empty($BUnloadingPosition['Expiration_date'])) {
                        echo substr($BUnloadingPosition['Expiration_date'], 0, 10);
                    }?></span></td>
        </tr>
        <tr>
            <td  colspan="3"> 事業区分 </td>
            <td  colspan="5"> <span class="input">{{$BUnloadingPosition['Permission_bussion']}}</span></td>
        </tr>
        <tr>
            <td  colspan="3"> 産業廃棄物の種類 </td>
            <td  colspan="5"> <span class="input">{{$BUnloadingPosition['Permission_type']}}</span></td>
        </tr>
        <tr>
            <td  colspan="3"> 許可の条件 </td>
            <td  colspan="5"> <span class="input">{{$BUnloadingPosition['Permission_condition']}}</span></td>
        </tr>
    </table>
    <table cellspacing="0" border="1px" class="tb1">
        <tr style="text-align: center;background-color: #cccccc">
            <td  colspan="8" align="center"><span>許可車両台数</span></td>
        </tr>
        <tr>
            <td  colspan="3" width="30%"> <span>許可車両</span> </td>
            <td  colspan="5" width="70%"> <span class="input">{{$CwContract['PartyB_Permitted_number_vehicles']}}台</span></td>
        </tr>
        <tr>
            <td  colspan="8"> <span>＊処分用で複数の収集運搬会社が同一の処分会社に搬入する場合は、収集運搬会社一覧表を参照</span></td>
        </tr>
    </table>
    <p></p>
@endif
@if($transportationFisposal)
    <table cellspacing="0" border="1px" class="tb1">
        <tr style="text-align: center;background-color: #cccccc">
            <td  colspan="8" align="center"><span>処分</span></td>
        </tr>
        <tr>
            <td  colspan="3" width="30%"> <span>許可番号</span> </td>
            <td  colspan="5" width="70%"> <span class="input">{{sizeof($CwPartyCLinkLicense->toArray()) > 0 ? $CwPartyCLinkLicense[0]->Permission_number : ''}}</span></td>
        </tr>
        <tr>
            <td  colspan="3"> <span>許可都道府県・政令市</span> </td>
            <td  colspan="5"> <span class="input">{{sizeof($CwPartyCLinkLicense->toArray()) > 0 ? $CwPartyCLinkLicense[0]->Permission_addr : ''}}</span></td>
        </tr>
        <tr>
            <td  colspan="3"> 許可の有効期限 </td>
            <td  colspan="5"> <span class="input"><?php
                    if (sizeof($CwPartyCLinkLicense->toArray()) > 0) {
                        if(!empty($CwPartyCLinkLicense[0]->Expiration_date)) {
                            echo substr($CwPartyCLinkLicense[0]->Expiration_date,0,10);
                        }
                    }
                    ?></span></td>
        </tr>
        <tr>
            <td  colspan="3"> 事業区分 </td>
            <td  colspan="5"> <span class="input">{{sizeof($CwPartyCLinkLicense->toArray()) > 0 ? $CwPartyCLinkLicense[0]->Permission_bussion : ''}}</span></td>
        </tr>
        <tr>
            <td  colspan="3"> 産業廃棄物の種類 </td>
            <td  colspan="5"> <span class="input">{{sizeof($CwPartyCLinkLicense->toArray()) > 0 ? $CwPartyCLinkLicense[0]->Permission_type : ''}}</span></td>
        </tr>
        <tr>
            <td  colspan="3"> 許可の条件 </td>
            <td  colspan="5"> <span class="input">{{sizeof($CwPartyCLinkLicense->toArray()) > 0 ? $CwPartyCLinkLicense[0]->Permission_condition : ''}}</span></td>
        </tr>
    </table>
@endif
<br pagebreak="true" />
<div class="tt1">別表２&nbsp;&nbsp;&nbsp;&nbsp;@if(!empty($table_title2))({{$table_title2}})@endif</div>
<table cellspacing="0" border="1px" class="tb1">
    <tr style="text-align: center; background-color: #cccccc">
        <td  colspan="8"> 委託業務の内容</td>
    </tr>
    <tr style="">
        <td  colspan="3" width="30%"> 工事名 </td>
        <td  colspan="5" width="70%"> <span class="input">{{sizeof($BusinessContents) > 0 ? $BusinessContents[0]['Construction_name'] : ''}}</span></td>
    </tr>
    <tr style="">
        <td colspan="3"> 排出場所 </td>
        <td  colspan="5"> <span class="input">{{sizeof($BusinessContents) > 0 ? $BusinessContents[0]['discharge_location'] : ''}}</span></td>
    </tr>
    <tr style="">
        <td colspan="3"> 委託期間 </td>
        <td  colspan="5"> <span class="input">{{$BusinessContentsDataStart['year']}}年{{$BusinessContentsDataStart['month']}}月{{$BusinessContentsDataStart['day']}}日 か ら{{$BusinessContentsDataEnd['year']}}年{{$BusinessContentsDataEnd['month']}}月{{$BusinessContentsDataEnd['day']}}日</span></td>
    </tr>
    <?php
    $Transshipment_via_storage_facility1 = "□";
    $Transshipment_via_storage_facility0 = "□";
    // 乙の運搬区間
    $value10196 = "";
    $value10197 = "";
    $value10198 = "";
    $value10199 = "";
    // ☐許・ ☐否
    $yes1 = "□";
    $no1 = "□";
    $yes2 = "□";
    $no2 = "□";
    ?>
    @if(!empty($partBTransportInterval))
        @foreach($partBTransportInterval as $item)
            @if($item['master_data_master_id'] == 10196)
                <?php $value10196="排出場所"?>
            @elseif($item['master_data_master_id'] == 10197)
                <?php $value10197="積替・保管施設"?>
            @elseif($item['master_data_master_id'] == 10198)
                <?php $value10198="積替・保管施設"?>
            @elseif($item['master_data_master_id'] == 10199)
                <?php $value10199="処分施設"?>
            @endif
        @endforeach
    @endif

    @if(sizeof($BusinessContents) > 0)
        @if($BusinessContents[0]['stable_industry_waste'] == '0')
            <?php $yes1="☑"?>
        @elseif($BusinessContents[0]['stable_industry_waste'] == '1')
            <?php $no1 = "☑"?>
        @endif

        @if($BusinessContents[0]['Transfer_storage'] == '0')
            <?php $yes2="☑"?>
        @elseif($BusinessContents[0]['Transfer_storage'] == '1')
            <?php $no2 = "☑"?>
        @endif
        @if($BusinessContents[0]['Transshipment_via_storage_facility'] == '1')
            <?php $Transshipment_via_storage_facility0 = "☑";
            $yes1 = "□";
            $yes2 = "□";
            $no1 = "□";
            $no2 = "□";
            $value10196 = "";
            $value10197 = "";
            $value10198 = "";
            $value10199 = "";
            ?>
        @elseif($BusinessContents[0]['Transshipment_via_storage_facility'] == '0')
            <?php $Transshipment_via_storage_facility1 = "☑";?>
        @endif
    @endif
    <tr style="">
        <td colspan="8"> 積替・保管施設経由の有無 （{{$Transshipment_via_storage_facility1}}有り・{{$Transshipment_via_storage_facility0}}無し）</td>
    </tr>
    <table cellspacing="0" border="1px" class="tb1">
        <tr style="text-align: center;background-color: #cccccc">
            <td  colspan="8" align="center"><span> 施設の内容</span></td>
        </tr>
        <tr>
            <td  colspan="3" width="30%"> <span>許可番号</span> </td>
            <td  colspan="5" width="70%"> <span class="input"><?php if(sizeof($BusinessContentsInfo)>0){
                        echo $BusinessContentsInfo[0]['Permission_number'];
                    } ?></span></td>
        </tr>
        <tr>
            <td  colspan="3"> <span>許可都道府県・政令市</span> </td>
            <td  colspan="5"> <span class="input"><?php if(sizeof($BusinessContentsInfo)>0){
                        echo $BusinessContentsInfo[0]['Permission_addr'];
                    } ?></span></td>
        </tr>
        <tr>
            <td  colspan="3"> 許可の有効期限 </td>
            <td  colspan="5"> <span class="input"><?php if(sizeof($BusinessContentsInfo)>0){
                        $d =  $BusinessContentsInfo[0]['Expiration_date'];
                        if ($d != '' && $d != null) {
                            echo substr($d,0,10);
                        }
                    } ?></span></td>
        </tr>
        <tr>
            <td  colspan="3"> 事業区分 </td>
            <td  colspan="5"> <span class="input"><?php echo sizeof($BusinessContentsInfo) > 0 ? $BusinessContentsInfo[0]['Permission_bussion'] : ''?></span></td>
        </tr>
        <tr>
            <td  colspan="3"> 産業廃棄物の種類 </td>
            <td  colspan="5"> <span class="input"><?php echo sizeof($BusinessContentsInfo) > 0 ? $BusinessContentsInfo[0]['Permission_type'] : '' ?></span></td>
        </tr>
        <tr>
            <td  colspan="3"> 許可の条件 </td>
            <td  colspan="5"> <span class="input"><?php echo sizeof($BusinessContentsInfo) > 0 ? $BusinessContentsInfo[0]['Permission_condition'] : '' ?></span></td>
        </tr>
    </table>
    <tr style="">
        <td colspan="3"> 乙の運搬区間 </td>
        <td  colspan="5">&nbsp;<span class="input">{{$value10196}}{{$value10197}} から {{$value10198}}{{$value10199}} まで </span></td>
    </tr>
    <tr style="">
        <td colspan="8"> 安定型産業廃棄物であるときは、積替又は保管場所において他の廃棄物と混合することの許否 ({{$yes1}}許・{{$no1}}否)</td>
    </tr>
    <tr style="">
        <td colspan="8"> 安定型産業廃棄物と管理型産業廃棄物とを混合して委託する場合、積替又は保管場所において、
            <span> 手選別を行うことの許否 ({{$yes2}}許・{{$no2}}否) </span></td>
    </tr>
</table>
<br pagebreak="true" />
<?php
// 予定数量
$num = '';
$num0 = '';
$num1 = '';
$num2 = '';
$num3 = '';
$num4 = '';
$num5 = '';
$num6 = '';
$num7 = '';
$num8 = '';
$num9 = '';
$num10 = '';
$num11 = '';
$num12 = '';
$num13 = '';
$num14 = '';
$num15 = '';
$num16 = '';
$num17 = '';
$num18 = '';
$num19 = '';
$num20 = '';
$num21 = '';
$num22 = '';
// 予定数量
$disposalQuantityNum = '';
$disposalQuantityNum0 = '';
$disposalQuantityNum1 = '';
$disposalQuantityNum2 = '';
$disposalQuantityNum3 = '';
$disposalQuantityNum4 = '';
$disposalQuantityNum5 = '';
$disposalQuantityNum6 = '';
$disposalQuantityNum7 = '';
$disposalQuantityNum8 = '';
$disposalQuantityNum9 = '';
$disposalQuantityNum10 = '';
$disposalQuantityNum11 = '';
$disposalQuantityNum12 = '';
$disposalQuantityNum13 = '';
$disposalQuantityNum14 = '';
$disposalQuantityNum15 = '';
$disposalQuantityNum16 = '';
$disposalQuantityNum17 = '';
$disposalQuantityNum18 = '';
$disposalQuantityNum19 = '';
$disposalQuantityNum20 = '';
$disposalQuantityNum21 = '';
$disposalQuantityNum22 = '';
// 収集運搬 契約単価
$priceOfCollection = '';
$priceOfCollection0 = '';
$priceOfCollection1 = '';
$priceOfCollection2 = '';
$priceOfCollection3 = '';
$priceOfCollection4 = '';
$priceOfCollection5 = '';
$priceOfCollection6 = '';
$priceOfCollection7 = '';
$priceOfCollection8 = '';
$priceOfCollection9 = '';
$priceOfCollection10 = '';
$priceOfCollection11 = '';
$priceOfCollection12 = '';
$priceOfCollection13 = '';
$priceOfCollection14 = '';
$priceOfCollection15 = '';
$priceOfCollection16 = '';
$priceOfCollection17 = '';
$priceOfCollection18 = '';
$priceOfCollection19 = '';
$priceOfCollection20 = '';
$priceOfCollection21 = '';
$priceOfCollection22 = '';

// 処分 契約単価
$priceOfDisposal = '';
$priceOfDisposal0 = '';
$priceOfDisposal1 = '';
$priceOfDisposal2 = '';
$priceOfDisposal3 = '';
$priceOfDisposal4 = '';
$priceOfDisposal5 = '';
$priceOfDisposal6 = '';
$priceOfDisposal7 = '';
$priceOfDisposal8 = '';
$priceOfDisposal9 = '';
$priceOfDisposal10 = '';
$priceOfDisposal11 = '';
$priceOfDisposal12 = '';
$priceOfDisposal13 = '';
$priceOfDisposal14 = '';
$priceOfDisposal15 = '';
$priceOfDisposal16 = '';
$priceOfDisposal17 = '';
$priceOfDisposal18 = '';
$priceOfDisposal19 = '';
$priceOfDisposal20 = '';
$priceOfDisposal21 = '';
$priceOfDisposal22 = '';

// 単位
$unit = '';
$unit0 = '';
$unit1 = '';
$unit2 = '';
$unit3 = '';
$unit4 = '';
$unit5 = '';
$unit6 = '';
$unit7 = '';
$unit8 = '';
$unit9 = '';
$unit10 = '';
$unit11 = '';
$unit12 = '';
$unit13 = '';
$unit14 = '';
$unit15 = '';
$unit16 = '';
$unit17 = '';
$unit18 = '';
$unit19 = '';
$unit20 = '';
$unit21 = '';
$unit22 = '';
// 単位
$unitAdd = '';
$unitAdd0 = '';
$unitAdd1 = '';
$unitAdd2 = '';
$unitAdd3 = '';
$unitAdd4 = '';
$unitAdd5 = '';
$unitAdd6 = '';
$unitAdd7 = '';
$unitAdd8 = '';
$unitAdd9 = '';
$unitAdd10 = '';
$unitAdd11 = '';
$unitAdd12 = '';
$unitAdd13 = '';
$unitAdd14 = '';
$unitAdd15 = '';
$unitAdd16 = '';
$unitAdd17 = '';
$unitAdd18 = '';
$unitAdd19 = '';
$unitAdd20 = '';
$unitAdd21 = '';
$unitAdd22 = '';
// 処分方法
$method = '';
$method0 = '';
$method1 = '';
$method2 = '';
$method3 = '';
$method4 = '';
$method5 = '';
$method6 = '';
$method7 = '';
$method8 = '';
$method9 = '';
$method10 = '';
$method11 = '';
$method12 = '';
$method13 = '';
$method14 = '';
$method15 = '';
$method16 = '';
$method17 = '';
$method18 = '';
$method19 = '';
$method20 = '';
$method21 = '';
$method22 = '';
// 処理能力
$capacity = '';
$capacity0 = '';
$capacity1 = '';
$capacity2 = '';
$capacity3 = '';
$capacity4 = '';
$capacity5 = '';
$capacity6 = '';
$capacity7 = '';
$capacity8 = '';
$capacity9 = '';
$capacity10 = '';
$capacity11 = '';
$capacity12 = '';
$capacity13 = '';
$capacity14 = '';
$capacity15 = '';
$capacity16 = '';
$capacity17 = '';
$capacity18 = '';
$capacity19 = '';
$capacity20 = '';
$capacity21 = '';
$capacity22 = '';
// 施設の名称・所在地
$addr = '';
$addr0 = '';
$addr1= '';
$addr2 = '';
$addr3 = '';
$addr4 = '';
$addr5 = '';
$addr6 = '';
$addr7 = '';
$addr8 = '';
$addr9 = '';
$addr10 = '';
$addr11 = '';
$addr12 = '';
$addr13 = '';
$addr14 = '';
$addr15 = '';
$addr16 = '';
$addr17 = '';
$addr18 = '';
$addr19 = '';
$addr20 = '';
$addr21 = '';
$addr22 = '';
// 単位
// 単位
$numUnit = '';
$numUnit0 = '';
$numUnit1 = '';
$numUnit2 = '';
$numUnit3 = '';
$numUnit4 = '';
$numUnit5 = '';
$numUnit6 = '';
$numUnit7 = '';
$numUnit8 = '';
$numUnit9 = '';
$numUnit10 = '';
$numUnit11 = '';
$numUnit12 = '';
$numUnit13 = '';
$numUnit14 = '';
$numUnit15 = '';
$numUnit16 = '';
$numUnit17 = '';
$numUnit18 = '';
$numUnit19 = '';
$numUnit20 = '';
$numUnit21 = '';
$numUnit22 = '';
// 単位
$disNumUnit = '';
$disNumUnit0 = '';
$disNumUnit1 = '';
$disNumUnit2 = '';
$disNumUnit3 = '';
$disNumUnit4 = '';
$disNumUnit5 = '';
$disNumUnit6 = '';
$disNumUnit7 = '';
$disNumUnit8 = '';
$disNumUnit9 = '';
$disNumUnit10 = '';
$disNumUnit11 = '';
$disNumUnit12 = '';
$disNumUnit13 = '';
$disNumUnit14 = '';
$disNumUnit15 = '';
$disNumUnit16 = '';
$disNumUnit17 = '';
$disNumUnit18 = '';
$disNumUnit19 = '';
$disNumUnit20 = '';
$disNumUnit21 = '';
$disNumUnit22 = '';
// other
$other2 = '';
$other15 = '';
$other21 = '';
$other19 = '';
$other18 = '';

foreach ($PermissionIteminfoSuccess as $item) {
//        $num = $item['Planned_quantity'];
//        $priceOfCollection = $item['Contract_unit_price_Collection_transportation'];
//        $priceOfDisposal = $item['Contract_unit_price_Disposal'];
    $disposalRealQuantityUnit = $item['Disposal_quantity_unit'];
    $plannedRealQuantityUnit = $item['Planned_quantity_unit'];
    $unitMasterData = $item['Planned_quantity_unit'];
    $priceOfCollection = preg_match("/^\d+$/",$item['Contract_unit_price_Collection_transportation']) ? number_format($item['Contract_unit_price_Collection_transportation']) : $item['Contract_unit_price_Collection_transportation'];
    $priceOfDisposal = preg_match("/^\d+$/",$item['Contract_unit_price_Disposal']) ? number_format($item['Contract_unit_price_Disposal']) : $item['Contract_unit_price_Disposal'];
    $num = preg_match("/^\d+$/",$item['Planned_quantity']) ? number_format($item['Planned_quantity']) : $item['Planned_quantity'];
    $disposalQuantity = preg_match("/^\d+$/",$item['Disposal_quantity']) ? number_format($item['Disposal_quantity']) : $item['Disposal_quantity'];
    $disQuantityUnit = $item['Disposal_quantity_unit'];
    $method = $item['Disposal_method'];
    $capacity = $item['Processing_capacity_day'];
    $addr = $item['Name_and_location_facility'];
    $other = $item['order_text'];
    switch ($unitMasterData) {
        case 10164:
            $unit = '/kg';
            break;
        case 10165:
            $unit = '/ｔ';
            break;
        case 10166:
            $unit = '/㍑';
            break;
        case 10167:
            $unit = '/m3';
            break;
        case 10168:
            $unit = '/本';
            break;
        case 10169:
            $unit = '/缶';
            break;
        case 10170:
            $unit = '/袋';
            break;
        case 10171:
            $unit = '/個';
            break;
        case 10285:
            $unit = '/台';
            break;
        case 10330:
            $unit = '/車';
            break;
        case 10331:
            $unit = '/回';
            break;
        case 10332:
            $unit = ' ';
            break;
        default: $unit = '';
            break;
    }
    switch ($disQuantityUnit) {
        case 10164:
            $unitAdd = '/kg';
            break;
        case 10165:
            $unitAdd = '/ｔ';
            break;
        case 10166:
            $unitAdd = '/㍑';
            break;
        case 10167:
            $unitAdd = '/m3';
            break;
        case 10168:
            $unitAdd = '/本';
            break;
        case 10169:
            $unitAdd = '/缶';
            break;
        case 10170:
            $unitAdd = '/袋';
            break;
        case 10171:
            $unitAdd = '/個';
            break;
        case 10285:
            $unitAdd = '/台';
            break;
        case 10330:
            $unitAdd = '/車';
            break;
        case 10331:
            $unitAdd = '/回';
            break;
        case 10332:
            $unitAdd = ' ';
            break;
        default: $unitAdd = '';
            break;
    }
    switch ($disposalRealQuantityUnit) {
        case 10164:
            $disNumUnit = '/kg';
            break;
        case 10165:
            $disNumUnit = '/ｔ';
            break;
        case 10166:
            $disNumUnit = '/㍑';
            break;
        case 10167:
            $disNumUnit = '/m3';
            break;
        case 10168:
            $disNumUnit = '/本';
            break;
        case 10169:
            $disNumUnit = '/缶';
            break;
        case 10170:
            $disNumUnit = '/袋';
            break;
        case 10171:
            $disNumUnit = '/個';
            break;
        case 10285:
            $disNumUnit = '/台';
            break;
        case 10330:
            $disNumUnit = '/車';
            break;
        case 10331:
            $disNumUnit = '/回';
            break;
        case 10332:
            $disNumUnit = ' ';
            break;
        default: $disNumUnit = '';
            break;
    }
    switch ($plannedRealQuantityUnit) {
        case 10164:
            $numUnit = '/kg';
            break;
        case 10165:
            $numUnit = '/ｔ';
            break;
        case 10166:
            $numUnit = '/㍑';
            break;
        case 10167:
            $numUnit = '/m3';
            break;
        case 10168:
            $numUnit = '/本';
            break;
        case 10169:
            $numUnit = '/缶';
            break;
        case 10170:
            $numUnit = '/袋';
            break;
        case 10171:
            $numUnit = '/個';
            break;
        case 10285:
            $numUnit = '/台';
            break;
        case 10330:
            $numUnit = '/車';
            break;
        case 10331:
            $numUnit = '/回';
            break;
        case 10332:
            $numUnit = ' ';
            break;
        default: $numUnit = '';
            break;
    }
    if ($item['master_data_master_id'] == '10073') { // コンクリートがら
        $num0 = $num;
        $disposalQuantityNum0 = $disposalQuantity;
        $disNumUnit0 = $disNumUnit;
        $unitAdd0 = $unitAdd;
        $priceOfCollection0 = $priceOfCollection;
        $priceOfDisposal0 = $priceOfDisposal;
        $unit0 = $unit;
        $numUnit0 = $numUnit;
        $method0 = $method;
        $capacity0 = $capacity;
        $addr0 = $addr;
    }else if($item['master_data_master_id'] == '10074'){ // アスファルト・コンクリートがら
        $num1 = $num;
        $disposalQuantityNum1 = $disposalQuantity;
        $numUnit1 = $numUnit;
        $disNumUnit1 = $disNumUnit;
        $unitAdd1 = $unitAdd;
        $priceOfCollection1 = $priceOfCollection;
        $priceOfDisposal1 = $priceOfDisposal;
        $unit1 = $unit;
        $method1 = $method;
        $capacity1 = $capacity;
        $addr1 = $addr;
    }else if($item['master_data_master_id'] == '10075'){ // その他がれき類
        $num2 = $num;
        $disposalQuantityNum2 = $disposalQuantity;
        $numUnit2 = $numUnit;
        $disNumUnit2 = $disNumUnit;
        $unitAdd2 = $unitAdd;
        $priceOfCollection2 = $priceOfCollection;
        $priceOfDisposal2 = $priceOfDisposal;
        $unit2 = $unit;
        $method2 = $method;
        $capacity2 = $capacity;
        $addr2 = $addr;
        $other2 = $other;
    }else if($item['master_data_master_id'] == '10076'){ // ガラスくず・コンクリートくず及び陶磁器くず
        $num3 = $num;
        $disposalQuantityNum3 = $disposalQuantity;
        $numUnit3 = $numUnit;
        $disNumUnit3 = $disNumUnit;
        $unitAdd3 = $unitAdd;
        $priceOfCollection3 = $priceOfCollection;
        $priceOfDisposal3 = $priceOfDisposal;
        $unit3 = $unit;
        $method3 = $method;
        $capacity3 = $capacity;
        $addr3 = $addr;
    }else if($item['master_data_master_id'] == '10077'){ //廃プラスチック類
        $num4 = $num;
        $disposalQuantityNum4 = $disposalQuantity;
        $numUnit4 = $numUnit;
        $disNumUnit4 = $disNumUnit;
        $unitAdd4 = $unitAdd;
        $priceOfCollection4 = $priceOfCollection;
        $priceOfDisposal4 = $priceOfDisposal;
        $unit4 = $unit;
        $method4 = $method;
        $capacity4 = $capacity;
        $addr4 = $addr;
    }else if($item['master_data_master_id'] == '10078'){ // 金属くず
        $num5 = $num;
        $disposalQuantityNum5 = $disposalQuantity;
        $numUnit5 = $numUnit;
        $disNumUnit5 = $disNumUnit;
        $unitAdd5 = $unitAdd;
        $priceOfCollection5 = $priceOfCollection;
        $priceOfDisposal5 = $priceOfDisposal;
        $unit5 = $unit;
        $method5 = $method;
        $capacity5 = $capacity;
        $addr5 = $addr;
    }else if($item['master_data_master_id'] == '10079'){ // 紙くず
        $num6 = $num;
        $disposalQuantityNum6 = $disposalQuantity;
        $numUnit6 = $numUnit;
        $disNumUnit6 = $disNumUnit;
        $unitAdd6 = $unitAdd;
        $priceOfCollection6 = $priceOfCollection;
        $priceOfDisposal6 = $priceOfDisposal;
        $unit6 = $unit;
        $method6 = $method;
        $capacity6 = $capacity;
        $addr6 = $addr;
    }else if($item['master_data_master_id'] == '10080'){ // 木くず
        $num7 = $num;
        $disposalQuantityNum7 = $disposalQuantity;
        $numUnit7 = $numUnit;
        $disNumUnit7 = $disNumUnit;
        $unitAdd7 = $unitAdd;
        $priceOfCollection7 = $priceOfCollection;
        $priceOfDisposal7 = $priceOfDisposal;
        $unit7 = $unit;
        $method7 = $method;
        $capacity7 = $capacity;
        $addr7 = $addr;
    }else if($item['master_data_master_id'] == '10081'){ // 繊維くず
        $num8 = $num;
        $disposalQuantityNum8 = $disposalQuantity;
        $numUnit8 = $numUnit;
        $disNumUnit8 = $disNumUnit;
        $unitAdd8 = $unitAdd;
        $priceOfCollection8 = $priceOfCollection;
        $priceOfDisposal8 = $priceOfDisposal;
        $unit8 = $unit;
        $method8 = $method;
        $capacity8 = $capacity;
        $addr8 = $addr;
    }else if($item['master_data_master_id'] == '10082'){ // 廃石膏ボード
        $num9 = $num;
        $disposalQuantityNum9 = $disposalQuantity;
        $numUnit9 = $numUnit;
        $disNumUnit9 = $disNumUnit;
        $unitAdd9 = $unitAdd;
        $priceOfCollection9 = $priceOfCollection;
        $priceOfDisposal9 = $priceOfDisposal;
        $unit9 = $unit;
        $method9 = $method;
        $capacity9 = $capacity;
        $addr9 = $addr;
    }else if($item['master_data_master_id'] == '10083'){ // 建設汚泥
        $num22 = $num;
        $disposalQuantityNum22 = $disposalQuantity;
        $numUnit22 = $numUnit;
        $disNumUnit22 = $disNumUnit;
        $unitAdd22 = $unitAdd;
        $priceOfCollection22 = $priceOfCollection;
        $priceOfDisposal22 = $priceOfDisposal;
        $unit22 = $unit;
        $method22 = $method;
        $capacity22 = $capacity;
        $addr22 = $addr;
    }else if($item['master_data_master_id'] == '10084'){ // 安定型品目のみ
        $num10 = $num;
        $disposalQuantityNum10 = $disposalQuantity;
        $numUnit10 = $numUnit;
        $disNumUnit10 = $disNumUnit;
        $unitAdd10 = $unitAdd;
        $priceOfCollection10 = $priceOfCollection;
        $priceOfDisposal10 = $priceOfDisposal;
        $unit10 = $unit;
        $method10 = $method;
        $capacity10 = $capacity;
        $addr10 = $addr;
    }
    else if($item['master_data_master_id'] == '10085'){// 管理型品目含む
        $num11 = $num;
        $disposalQuantityNum11 = $disposalQuantity;
        $numUnit11 = $numUnit;
        $disNumUnit11 = $disNumUnit;
        $unitAdd11 = $unitAdd;
        $priceOfCollection11 = $priceOfCollection;
        $priceOfDisposal11 = $priceOfDisposal;
        $unit11 = $unit;
        $method11 = $method;
        $capacity11 = $capacity;
        $addr11 = $addr;
    }
    else if($item['master_data_master_id'] == '10086'){// がれき類
        $num12 = $num;
        $disposalQuantityNum12 = $disposalQuantity;
        $numUnit12 = $numUnit;
        $disNumUnit12 = $disNumUnit;
        $unitAdd12 = $unitAdd;
        $priceOfCollection12 = $priceOfCollection;
        $priceOfDisposal12 = $priceOfDisposal;
        $unit12 = $unit;
        $method12 = $method;
        $capacity12 = $capacity;
        $addr12 = $addr;
    }
    else if($item['master_data_master_id'] == '10087'){ //ガラスくず・コンクリートくず及び陶磁器くず
        $num13 = $num;
        $disposalQuantityNum13 = $disposalQuantity;
        $numUnit13 = $numUnit;
        $disNumUnit13 = $disNumUnit;
        $unitAdd13 = $unitAdd;
        $priceOfCollection13 = $priceOfCollection;
        $priceOfDisposal13 = $priceOfDisposal;
        $unit13 = $unit;
        $method13 = $method;
        $capacity13 = $capacity;
        $addr13 = $addr;
    }
    else if($item['master_data_master_id'] == '10089'){ // 廃プラスチック類
        $num14 = $num;
        $disposalQuantityNum14 = $disposalQuantity;
        $numUnit14 = $numUnit;
        $disNumUnit14 = $disNumUnit;
        $unitAdd14 = $unitAdd;
        $priceOfCollection14 = $priceOfCollection;
        $priceOfDisposal14 = $priceOfDisposal;
        $unit14 = $unit;
        $method14 = $method;
        $capacity14 = $capacity;
        $addr14 = $addr;
    }
    else if($item['master_data_master_id'] == '10090'){ // 10090その他
        $num15 = $num;
        $disposalQuantityNum15 = $disposalQuantity;
        $numUnit15 = $numUnit;
        $disNumUnit15 = $disNumUnit;
        $unitAdd15 = $unitAdd;
        $priceOfCollection15 = $priceOfCollection;
        $priceOfDisposal15 = $priceOfDisposal;
        $unit15 = $unit;
        $method15 = $method;
        $capacity15 = $capacity;
        $addr15 = $addr;
        $other15 = $other;
    }
    else if($item['master_data_master_id'] == '10279'){ // ｶﾞﾗｽくず、ｺﾝｸﾘｰﾄくず及び陶磁器くず
        $num16 = $num;
        $disposalQuantityNum16 = $disposalQuantity;
        $numUnit16 = $numUnit;
        $disNumUnit16 = $disNumUnit;
        $unitAdd16 = $unitAdd;
        $priceOfCollection16 = $priceOfCollection;
        $priceOfDisposal16 = $priceOfDisposal;
        $unit16 = $unit;
        $method16 = $method;
        $capacity16 = $capacity;
        $addr16 = $addr;
    }
    else if($item['master_data_master_id'] == '10280'){
        $num17 = $num;
        $disposalQuantityNum17 = $disposalQuantity;
        $numUnit17 = $numUnit;
        $disNumUnit17 = $disNumUnit;
        $unitAdd17 = $unitAdd;
        $priceOfCollection17 = $priceOfCollection;
        $priceOfDisposal17 = $priceOfDisposal;
        $unit17 = $unit;
        $method17 = $method;
        $capacity17 = $capacity;
        $addr17 = $addr;
    }
    else if($item['master_data_master_id'] == '10281'){
        $num18 = $num;
        $disposalQuantityNum18 = $disposalQuantity;
        $numUnit18 = $numUnit;
        $disNumUnit18 = $disNumUnit;
        $unitAdd18 = $unitAdd;
        $priceOfCollection18 = $priceOfCollection;
        $priceOfDisposal18 = $priceOfDisposal;
        $unit18 = $unit;
        $method18 = $method;
        $capacity18 = $capacity;
        $addr18 = $addr;
        $other18 = $other;
    }
    else if($item['master_data_master_id'] == '10091'){
        $num19 = $num;
        $disposalQuantityNum19 = $disposalQuantity;
        $numUnit19 = $numUnit;
        $disNumUnit19 = $disNumUnit;
        $unitAdd19 = $unitAdd;
        $priceOfCollection19 = $priceOfCollection;
        $priceOfDisposal19 = $priceOfDisposal;
        $unit19 = $unit;
        $method19 = $method;
        $capacity19 = $capacity;
        $addr19 = $addr;
        $other19 = $other;
    }
    else if($item['master_data_master_id'] == '10092'){
        $num20 = $num;
        $disposalQuantityNum20 = $disposalQuantity;
        $numUnit20 = $numUnit;
        $disNumUnit20 = $disNumUnit;
        $unitAdd20 = $unitAdd;
        $priceOfCollection20 = $priceOfCollection;
        $priceOfDisposal20 = $priceOfDisposal;
        $unit20 = $unit;
        $method20 = $method;
        $capacity20 = $capacity;
        $addr20 = $addr;
    }
    else if($item['master_data_master_id'] == '10282'){
        $num21 = $num;
        $disposalQuantityNum21 = $disposalQuantity;
        $numUnit21 = $numUnit;
        $disNumUnit21 = $disNumUnit;
        $unitAdd21 = $unitAdd;
        $priceOfCollection21 = $priceOfCollection;
        $priceOfDisposal21 = $priceOfDisposal;
        $unit21 = $unit;
        $method21 = $method;
        $capacity21 = $capacity;
        $addr21 = $addr;
        $other21 = $other;
    }
}
// 事前協議の要否
$beforeIs = "□";
$beforeNot = "□";
$Properties = '';
$Packing = '';
if(sizeof($cwInfomation) > 0) {
    $info = $cwInfomation[0];
    if ($info['prior_consultation'] == '0') {
        $beforeIs = "☑";
    }else{
        $beforeNot = "☑";
    }
    $Properties = $info['Properties'];
    $Packing = $info['Packing'];
}
?>
<div class="tt1">別表３&nbsp;&nbsp;&nbsp;&nbsp;@if(!empty($table_title3))({{$table_title3}})@endif</div>
<table  cellspacing="0" border="1" cellpadding="5px" style="font-size: small;vertical-align: middle;">
    <tr style="text-align: center; background-color: #cccccc">
        <td  colspan="11"> 廃棄物の契約情報</td>
    </tr>
    <tr align="center">
        <td rowspan="3" colspan="3" style="vertical-align:middle;line-height: 54px"><span>廃棄物の種類</span></td>
        <td colspan="4">契約予定数量及び金額</td>
        <td colspan="4" rowspan="2" style="line-height: 34px"><span>処分会社の許可内容</span></td>
    </tr>
    <tr align="center" valign="middle">
        <td colspan="2">  契約単価(円/単位)</td>
        <td colspan="2">予定数量</td>
    </tr>
    <tr align="center" valign="middle">
        <td >収集運搬</td>
        <td>処分</td>
        <td>収集運搬</td>
        <td>処分</td>
        <td>処分方法</td>
        <td>処理能力</td>
        <td colspan="2">施設の名称・所在地</td>
    </tr>
    <tr>
        <td colspan="3">コンクリートがら</td>
        <td style="text-align: center">
            <?php
            echo $priceOfCollection0 == '' ? '' : $priceOfCollection0.'円'.$unit0;
            ?>
        </td>
        <td style="text-align: center">
            <?php
            echo $priceOfDisposal0 == '' ? '' : $priceOfDisposal0.'円'.$unitAdd0;
            ?>
        </td>
        <td style="text-align: center">{{$num0}}{{$numUnit0}}</td>
        <td style="text-align: center">{{$disposalQuantityNum0}}{{$disNumUnit0}}</td>
        <td style="text-align: center">{{$method0}}</td>
        <td style="text-align: center">
            <?php
            //                echo $capacity0 == '' ? '' : $capacity0.$unit0.'/日';
            echo $capacity0 == '' ? '' : $capacity0;
            ?>
        </td>
        <td colspan="2" style="text-align: center">{{$addr0}}</td>
    </tr>
    <tr>
        <td colspan="3">ｱｽﾌｧﾙﾄ・ｺﾝｸﾘｰﾄｶﾞら</td>
        <td style="text-align: center">
            <?php
            echo $priceOfCollection1 == '' ? '' : $priceOfCollection1.'円/'.$unit1;
            ?>
        </td>
        <td style="text-align: center">
            <?php
            echo $priceOfDisposal1 == '' ? '' : $priceOfDisposal1.'円/'.$unitAdd0;
            ?>
        </td>
        <td style="text-align: center">{{$num1}}{{$numUnit1}}</td>
        <td style="text-align: center">{{$disposalQuantityNum1}}{{$disNumUnit1}}</td>
        <td style="text-align: center">{{$method1}}</td>
        <td style="text-align: center">
            <?php
            //                echo $capacity1 == '' ? '' : $capacity1.$unit1.'/日';
            echo $capacity1 == '' ? '' : $capacity1;
            ?>
        </td>
        <td colspan="2" style="text-align: center">{{$addr1}}</td>
    </tr>
    <tr>
        <td colspan="2">その他がれき類</td>
        <td style="color: black">（{{$other2}}）</td>
        <td style="text-align: center">
            <?php
            echo $priceOfCollection2 == '' ? '' : $priceOfCollection2.'円/'.$unit2;
            ?>
        </td>
        <td style="text-align: center">
            <?php
            echo $priceOfDisposal2 == '' ? '' : $priceOfDisposal2.'円/'.$unitAdd2;
            ?>
        </td>
        <td style="text-align: center">{{$num2}}{{$numUnit2}}</td>
        <td style="text-align: center">{{$disposalQuantityNum2}}{{$disNumUnit2}}</td>
        <td style="text-align: center">{{$method2}}</td>
        <td style="text-align: center">
            <?php
            //                echo $capacity2 == '' ? '' : $capacity2.$unit2.'/日';
            echo $capacity2 == '' ? '' : $capacity2;
            ?>
        </td>
        <td colspan="2" style="text-align: center">{{$addr2}}</td>
    </tr>
    <tr>
        <td colspan="3">ｶﾞﾗｽくず・ｺﾝｸﾘｰﾄくず及び陶磁器くず</td>
        <td style="text-align: center">
            <?php
            echo $priceOfCollection3 == '' ? '' : $priceOfCollection3.'円/'.$unit3;
            ?>
        </td>
        <td style="text-align: center">
            <?php
            echo $priceOfDisposal3 == '' ? '' : $priceOfDisposal3.'円/'.$unitAdd3;
            ?>
        </td>
        <td style="text-align: center">{{$num3}}{{$numUnit3}}</td>
        <td style="text-align: center">{{$disposalQuantityNum3}}{{$disNumUnit3}}</td>
        <td style="text-align: center">{{$method3}}</td>
        <td style="text-align: center">
            <?php
            //                echo $capacity3 == '' ? '' : $capacity3.$unit3.'/日';
            echo $capacity3 == '' ? '' : $capacity3;
            ?>
        </td>
        <td colspan="2" style="text-align: center">{{$addr3}}</td>
    </tr>
    <tr>
        <td colspan="3">廃プラスチック類</td>
        <td style="text-align: center">
            <?php
            echo $priceOfCollection4 == '' ? '' : $priceOfCollection4.'円/'.$unit4;
            ?>
        </td>
        <td style="text-align: center">
            <?php
            echo $priceOfDisposal4 == '' ? '' : $priceOfDisposal4.'円/'.$unitAdd4;
            ?>
        </td>
        <td style="text-align: center">{{$num4}}{{$numUnit4}}</td>
        <td style="text-align: center">{{$disposalQuantityNum4}}{{$disNumUnit4}}</td>
        <td style="text-align: center">{{$method4}}</td>
        <td style="text-align: center">
            <?php
            //                echo $capacity4 == '' ? '' : $capacity4.$unit4.'/日';
            echo $capacity4 == '' ? '' : $capacity4;
            ?>
        </td>
        <td colspan="2" style="text-align: center">{{$addr4}}</td>
    </tr>
    <tr>
        <td colspan="3">金属くず</td>
        <td style="text-align: center">
            <?php
            echo $priceOfCollection5 == '' ? '' : $priceOfCollection5.'円/'.$unit5;
            ?>
        </td>
        <td style="text-align: center">
            <?php
            echo $priceOfDisposal5 == '' ? '' : $priceOfDisposal5.'円/'.$unitAdd5;
            ?>
        </td>
        <td style="text-align: center">{{$num5}}{{$numUnit5}}</td>
        <td style="text-align: center">{{$disposalQuantityNum5}}{{$disNumUnit5}}</td>
        <td style="text-align: center">{{$method5}}</td>
        <td style="text-align: center">
            <?php
            //                echo $capacity5 == '' ? '' : $capacity5.$unit5.'/日';
            echo $capacity5 == '' ? '' : $capacity5;
            ?>
        </td>
        <td colspan="2" style="text-align: center">{{$addr5}}</td>
    </tr>
    <tr>
        <td colspan="3">紙くず</td>
        <td style="text-align: center">
            <?php
            echo $priceOfCollection6 == '' ? '' : $priceOfCollection6.'円/'.$unit6;
            ?>
        </td>
        <td style="text-align: center">
            <?php
            echo $priceOfDisposal6 == '' ? '' : $priceOfDisposal6.'円/'.$unitAdd6;
            ?>
        </td>
        <td style="text-align: center">{{$num6}}{{$numUnit6}}</td>
        <td style="text-align: center">{{$disposalQuantityNum6}}{{$disNumUnit6}}</td>
        <td style="text-align: center">{{$method6}}</td>
        <td style="text-align: center">
            <?php
            //                echo $capacity6 == '' ? '' : $capacity6.$unit6.'/日';
            echo $capacity6 == '' ? '' : $capacity6;
            ?>
        </td>
        <td colspan="2" style="text-align: center">{{$addr6}}</td>
    </tr>
    <tr>
        <td colspan="3">木くず</td>
        <td style="text-align: center">
            <?php
            echo $priceOfCollection7 == '' ? '' : $priceOfCollection7.'円/'.$unit7;
            ?>
        </td>
        <td style="text-align: center">
            <?php
            echo $priceOfDisposal7 == '' ? '' : $priceOfDisposal7.'円/'.$unitAdd7;
            ?>
        </td>
        <td style="text-align: center">{{$num7}}{{$numUnit7}}</td>
        <td style="text-align: center">{{$disposalQuantityNum7}}{{$disNumUnit7}}</td>
        <td style="text-align: center">{{$method7}}</td>
        <td style="text-align: center">
            <?php
            //                echo $capacity7 == '' ? '' : $capacity7.$unit7.'/日';
            echo $capacity7 == '' ? '' : $capacity7;
            ?>
        </td>
        <td colspan="2" style="text-align: center">{{$addr7}}</td>
    </tr>
    <tr>
        <td colspan="3">繊維くず</td>
        <td style="text-align: center">
            <?php
            echo $priceOfCollection8 == '' ? '' : $priceOfCollection8.'円/'.$unit8;
            ?>
        </td>
        <td style="text-align: center">
            <?php
            echo $priceOfDisposal8 == '' ? '' : $priceOfDisposal8.'円/'.$unitAdd8;
            ?>
        </td>
        <td style="text-align: center">{{$num8}}{{$numUnit8}}</td>
        <td style="text-align: center">{{$disposalQuantityNum8}}{{$disNumUnit8}}</td>
        <td style="text-align: center">{{$method8}}</td>
        <td style="text-align: center">
            <?php
            //                echo $capacity8 == '' ? '' : $capacity8.$unit8.'/日';
            echo $capacity8 == '' ? '' : $capacity8;
            ?>
        </td>
        <td colspan="2" style="text-align: center">{{$addr8}}</td>
    </tr>
    <tr>
        <td colspan="3">廃石膏ボード</td>
        <td style="text-align: center">
            <?php
            echo $priceOfCollection9 == '' ? '' : $priceOfCollection9.'円/'.$unit9;
            ?>
        </td>
        <td style="text-align: center">
            <?php
            echo $priceOfDisposal9 == '' ? '' : $priceOfDisposal9.'円/'.$unitAdd9;
            ?>
        </td>
        <td style="text-align: center">{{$num9}}{{$numUnit9}}</td>
        <td style="text-align: center">{{$disposalQuantityNum9}}{{$disNumUnit9}}</td>
        <td style="text-align: center">{{$method9}}</td>
        <td style="text-align: center">
            <?php
            //                echo $capacity9 == '' ? '' : $capacity9.$unit9.'/日';
            echo $capacity9 == '' ? '' : $capacity9;
            ?>
        </td>
        <td colspan="2" style="text-align: center">{{$addr9}}</td>
    </tr>
    <tr>
        <td colspan="3">建設汚泥</td>
        <td style="text-align: center">
            <?php
            echo $priceOfCollection22 == '' ? '' : $priceOfCollection22.'円/'.$unit22;
            ?>
        </td>
        <td style="text-align: center">
            <?php
            echo $priceOfDisposal22 == '' ? '' : $priceOfDisposal22.'円/'.$unitAdd22;
            ?>
        </td>
        <td style="text-align: center">{{$num22}}{{$numUnit22}}</td>
        <td style="text-align: center">{{$disposalQuantityNum22}}{{$disNumUnit22}}</td>
        <td style="text-align: center">{{$method22}}</td>
        <td style="text-align: center">
            <?php
            //                echo $capacity22 == '' ? '' : $capacity22.$unit22.'/日';
            echo $capacity22 == '' ? '' : $capacity22;
            ?>
        </td>
        <td colspan="2" style="text-align: center">{{$addr22}}</td>
    </tr>
    <tr>
        <td rowspan="2" style="vertical-align:middle">混合廃棄物</td>
        <td colspan="2">安定型品目のみ</td>
        <td style="text-align: center">
            <?php
            echo $priceOfCollection10 == '' ? '' : $priceOfCollection10.'円/'.$unit10;
            ?>
        </td>
        <td style="text-align: center">
            <?php
            echo $priceOfDisposal10 == '' ? '' : $priceOfDisposal10.'円/'.$unitAdd10;
            ?>
        </td>
        <td style="text-align: center">{{$num10}}{{$numUnit10}}</td>
        <td style="text-align: center">{{$disposalQuantityNum10}}{{$disNumUnit10}}</td>
        <td style="text-align: center">{{$method10}}</td>
        <td style="text-align: center">
            <?php
            //                echo $capacity10 == '' ? '' : $capacity10.$unit10.'/日';
            echo $capacity10 == '' ? '' : $capacity10;
            ?>
        </td>
        <td colspan="2" style="text-align: center">{{$addr10}}</td>
    </tr>
    <tr>
        <td colspan="2">管理型品目含む</td>
        <td style="text-align: center">
            <?php
            echo $priceOfCollection11 == '' ? '' : $priceOfCollection11.'円/'.$unit11;
            ?>
        </td>
        <td style="text-align: center">
            <?php
            echo $priceOfDisposal11 == '' ? '' : $priceOfDisposal11.'円/'.$unitAdd11;
            ?>
        </td>
        <td style="text-align: center">{{$num11}}{{$numUnit11}}</td>
        <td style="text-align: center">{{$disposalQuantityNum11}}{{$disNumUnit11}}</td>
        <td style="text-align: center">{{$method11}}</td>
        <td style="text-align: center">
            <?php
            //                echo $capacity11 == '' ? '' : $capacity11.$unit11.'/日';
            echo $capacity11 == '' ? '' : $capacity11;
            ?>
        </td>
        <td colspan="2" style="text-align: center">{{$addr11}}</td>
    </tr>
    <tr>
        <td rowspan="4"><span><br/><br/><span>石綿含有産業廃棄物</span></span></td>
        <td colspan="2">がれき類</td>
        <td style="text-align: center">
            <?php
            echo $priceOfCollection12 == '' ? '' : $priceOfCollection12.'円/'.$unit12;
            ?>
        </td>
        <td style="text-align: center">
            <?php
            echo $priceOfDisposal12 == '' ? '' : $priceOfDisposal12.'円/'.$unitAdd12;
            ?>
        </td>
        <td style="text-align: center">{{$num12}}{{$numUnit12}}</td>
        <td style="text-align: center">{{$disposalQuantityNum12}}{{$disNumUnit12}}</td>
        <td style="text-align: center">{{$method12}}</td>
        <td style="text-align: center">
            <?php
            //                echo $capacity12 == '' ? '' : $capacity12.$unit12.'/日';
            echo $capacity12 == '' ? '' : $capacity12;
            ?>
        </td>
        <td colspan="2" style="text-align: center">{{$addr12}}</td>
    </tr>
    <tr>
        <td colspan="2"><span><span>ｶﾞﾗｽくず、ｺﾝｸﾘｰﾄくず及び陶磁器くず</span></span></td>
        <td style="text-align: center">
            <?php
            echo $priceOfCollection13 == '' ? '' : $priceOfCollection13.'円/'.$unit13;
            ?>
        </td>
        <td style="text-align: center">
            <?php
            echo $priceOfDisposal13 == '' ? '' : $priceOfDisposal13.'円/'.$unitAdd13;
            ?>
        </td>
        <td style="text-align: center">{{$num13}}{{$numUnit13}}</td>
        <td style="text-align: center">{{$disposalQuantityNum13}}{{$disNumUnit13}}</td>
        <td style="text-align: center">{{$method13}}</td>
        <td style="text-align: center">
            <?php
            //                echo $capacity13 == '' ? '' : $capacity13.$unit13.'/日';
            echo $capacity13 == '' ? '' : $capacity13;
            ?>
        </td>
        <td colspan="2" style="text-align: center">{{$addr13}}</td>
    </tr>
    <tr>
        <td colspan="2">廃プラスチック類</td>
        <td style="text-align: center">
            <?php
            echo $priceOfCollection14 == '' ? '' : $priceOfCollection14.'円/'.$unit14;
            ?>
        </td>
        <td style="text-align: center">
            <?php
            echo $priceOfDisposal14 == '' ? '' : $priceOfDisposal14.'円/'.$unitAdd14;
            ?>
        </td>
        <td style="text-align: center">{{$num14}}{{$numUnit14}}</td>
        <td style="text-align: center">{{$disposalQuantityNum14}}{{$disNumUnit14}}</td>
        <td style="text-align: center">{{$method14}}</td>
        <td style="text-align: center">
            <?php
            //                echo $capacity14 == '' ? '' : $capacity14.$unit14.'/日';
            echo $capacity14 == '' ? '' : $capacity14;
            ?>
        </td>
        <td colspan="2" style="text-align: center">{{$addr14}}</td>
    </tr>
    <tr>
        <td>その他</td>
        <td style="color: black">（{{$other15}}）</td>
        <td style="text-align: center">
            <?php
            echo $priceOfCollection15 == '' ? '' : $priceOfCollection15.'円/'.$unit15;
            ?>
        </td>
        <td style="text-align: center">
            <?php
            echo $priceOfDisposal15 == '' ? '' : $priceOfDisposal15.'円/'.$unitAdd15;
            ?>
        </td>
        <td style="text-align: center">{{$num15}}{{$numUnit15}}</td>
        <td style="text-align: center">{{$disposalQuantityNum15}}{{$disNumUnit15}}</td>
        <td style="text-align: center">{{$method15}}</td>
        <td style="text-align: center">
            <?php
            //                echo $capacity15 == '' ? '' : $capacity15.$unit15.'/日';
            echo $capacity15 == '' ? '' : $capacity15;
            ?>
        </td>
        <td colspan="2" style="text-align: center">{{$addr15}}</td>
    </tr>
    <tr>
        <td rowspan="3"><span><span><br/>水銀使用製品産業廃棄物</span></span></td>
        <td colspan="2"><span><span>ｶﾞﾗｽくず、ｺﾝｸﾘｰﾄくず及び陶磁器くず</span></span></td>
        <td style="text-align: center">
            <?php
            echo $priceOfCollection16 == '' ? '' : $priceOfCollection16.'円/'.$unit16;
            ?>
        </td>
        <td style="text-align: center">
            <?php
            echo $priceOfDisposal16 == '' ? '' : $priceOfDisposal16.'円/'.$unitAdd16;
            ?>
        </td>
        <td style="text-align: center">{{$num16}}{{$numUnit16}}</td>
        <td style="text-align: center">{{$disposalQuantityNum16}}{{$disNumUnit16}}</td>
        <td style="text-align: center">{{$method16}}</td>
        <td style="text-align: center">
            <?php
            //                echo $capacity16 == '' ? '' : $capacity16.$unit16.'/日';
            echo $capacity16 == '' ? '' : $capacity16;
            ?>
        </td>
        <td colspan="2" style="text-align: center">{{$addr16}}</td>
    </tr>
    <tr>
        <td colspan="2">金属くず</td>
        <td style="text-align: center">
            <?php
            echo $priceOfCollection17 == '' ? '' : $priceOfCollection17.'円/'.$unit17;
            ?>
        </td>
        <td style="text-align: center">
            <?php
            echo $priceOfDisposal17 == '' ? '' : $priceOfDisposal17.'円/'.$unitAdd17;
            ?>
        </td>
        <td style="text-align: center">{{$num17}}{{$numUnit17}}</td>
        <td style="text-align: center">{{$disposalQuantityNum17}}{{$disNumUnit17}}</td>
        <td style="text-align: center">{{$method17}}</td>
        <td style="text-align: center">
            <?php
            //                echo $capacity17 == '' ? '' : $capacity17.$unit17.'/日';
            echo $capacity17 == '' ? '' : $capacity17;
            ?>
        </td>
        <td colspan="2" style="text-align: center">{{$addr17}}</td>
    </tr>
    <tr>
        <td>その他</td>
        <td style="color: black">（{{$other18}}） </td>
        <td style="text-align: center">
            <?php
            echo $priceOfCollection18 == '' ? '' : $priceOfCollection18.'円/'.$unit18;
            ?>
        </td>
        <td style="text-align: center">
            <?php
            echo $priceOfDisposal18 == '' ? '' : $priceOfDisposal18.'円/'.$unitAdd18;
            ?>
        </td>
        <td style="text-align: center">{{$num18}}{{$numUnit18}}</td>
        <td style="text-align: center">{{$disposalQuantityNum18}}{{$disNumUnit18}}</td>
        <td style="text-align: center">{{$method18}}</td>
        <td style="text-align: center">
            <?php
            //                echo $capacity18 == '' ? '' : $capacity18.$unit18.'/日';
            echo $capacity18 == '' ? '' : $capacity18;
            ?>
        </td>
        <td colspan="2" style="text-align: center">{{$addr18}}</td>
    </tr>
    <tr>
        <td>その他</td>
        <td colspan="2" style="color: black">（{{$other19}}） </td>
        <td style="text-align: center">
            <?php
            echo $priceOfCollection19 == '' ? '' : $priceOfCollection19.'円/'.$unit19;
            ?>
        </td>
        <td style="text-align: center">
            <?php
            echo $priceOfDisposal19 == '' ? '' : $priceOfDisposal19.'円/'.$unitAdd19;
            ?>
        </td>
        <td style="text-align: center">{{$num19}}{{$numUnit19}}</td>
        <td style="text-align: center">{{$disposalQuantityNum19}}{{$disNumUnit19}}</td>
        <td style="text-align: center">{{$method19}}</td>
        <td style="text-align: center">
            <?php
            //                echo $capacity19 == '' ? '' : $capacity19.$unit19.'/日';
            echo $capacity19 == '' ? '' : $capacity19;
            ?>
        </td>
        <td colspan="2" style="text-align: center">{{$addr19}}</td>
    </tr>
    <tr>
        <td rowspan="2" style="line-height: 36px">特管産廃</td>
        <td colspan="2">廃石綿等</td>
        <td style="text-align: center">
            <?php
            echo $priceOfCollection20 == '' ? '' : $priceOfCollection20.'円/'.$unit20;
            ?>
        </td>
        <td style="text-align: center">
            <?php
            echo $priceOfDisposal20 == '' ? '' : $priceOfDisposal20.'円/'.$unitAdd20;
            ?>
        </td>
        <td style="text-align: center">{{$num20}}{{$numUnit20}}</td>
        <td style="text-align: center">{{$disposalQuantityNum20}}{{$disNumUnit20}}</td>
        <td style="text-align: center">{{$method20}}</td>
        <td style="text-align: center">
            <?php
            //                echo $capacity20 == '' ? '' : $capacity20.$unit20.'/日';
            echo $capacity20 == '' ? '' : $capacity20;
            ?>
        </td>
        <td colspan="2" style="text-align: center">{{$addr20}}</td>
    </tr>
    <tr>
        <td>その他</td>
        <td style="color: black">（{{$other21}}） </td>
        <td style="text-align: center">
            <?php
            echo $priceOfCollection21 == '' ? '' : $priceOfCollection21.'円/'.$unit21;
            ?>
        </td>
        <td style="text-align: center">
            <?php
            echo $priceOfDisposal21 == '' ? '' : $priceOfDisposal21.'円/'.$unitAdd21;
            ?>
        </td>
        <td style="text-align: center">{{$num21}}{{$numUnit21}}</td>
        <td style="text-align: center">{{$disposalQuantityNum21}}{{$disNumUnit21}}</td>
        <td style="text-align: center">{{$method21}}</td>
        <td style="text-align: center">
            <?php
            //                echo $capacity21 == '' ? '' : $capacity21.$unit21.'/日';
            echo $capacity21 == '' ? '' : $capacity21;
            ?>
        </td>
        <td colspan="2" style="text-align: center">{{$addr21}}</td>
    </tr>
    <tr>
        <td colspan="2" rowspan="2" style="line-height: 30px">合計予定金額</td>
        <td>収集運搬</td>
        <td colspan="4" style="text-align: right">
            <?php
            if (sizeof($totalAmountCw) > 0) {
                echo preg_match("/^\d+$/",$totalAmountCw[0]->collecting_transporting) ? number_format($totalAmountCw[0]->collecting_transporting) . ' 円' : $totalAmountCw[0]->collecting_transporting .'　';
            } else {
                echo '';
            }
            ?>
        </td>
        <td colspan="4"> 必要な情報（性状及び荷姿等）＊</td>
    </tr>
    <tr>
        <td>処分</td>
        <td colspan="4" style="text-align: right">
            <?php
            if (sizeof($totalAmountCw) > 0) {
                echo preg_match("/^\d+$/",$totalAmountCw[0]->dispose) ? number_format($totalAmountCw[0]->dispose) . ' 円' : $totalAmountCw[0]->dispose .'　';
            } else {
                echo '';
            }
            ?>
        </td>
        <td colspan="4" rowspan="2" style="color: black">性状：{{$Properties}}<br><br>荷姿：{{$Packing}}</td>
    </tr>
    <tr>
        <td colspan="3">事前協議の要否</td>
        <td colspan="4" style="color: black">  {{$beforeIs}} 要 ・ {{$beforeNot}} 否</td>
    </tr>
</table>
<p >注釈：処理能力の記載について、同一の処分方法が複数ある場合は、該当する処理能力欄のいずれか一つに能力を記入する。<br />
    ※：性状等に変更が生じた場合は、文書等により通知する。</p>
<br pagebreak="true" />
@if(!$transportation)
    <?php
    $reclaimedItem1 = '';
    $reclaimedItem2 = '';
    $reclaimedItem3 = '';
    $reclaimedItem4 = '';
    $reclaimedItem5 = '';
    $reclaimedItem6 = '';
    $reclaimedItem7 = '';
    $reclaimedItem8 = '';
    $reclaimedItem9 = '';
    $reclaimedItem10 = '';
    $reclaimedItem11 = '';
    $reclaimedItem12 = '';
    $sellerEtc1 = '';
    $sellerEtc2 = '';
    $sellerEtc3 = '';
    $sellerEtc4 = '';
    $sellerEtc5 = '';
    $sellerEtc6 = '';
    $sellerEtc7 = '';
    $sellerEtc8 = '';
    $sellerEtc9 = '';
    $sellerEtc10 = '';
    $sellerEtc11 = '';
    $sellerEtc12 = '';

    if(sizeof($finalDisposalContent)>0){
        for($i=0;$i<sizeof($finalDisposalContent);$i++){
            $reclaimedItem = $finalDisposalContent[$i]->RECLAIMED_ITEM;
//            for ($y=0;$y<sizeof($masterData);$y++) {
//                if ($finalDisposalContent[$i]->waste_type == $masterData[$y]['master_id']) {
//                    $reclaimedItem = $masterData[$y]['master_data'];
//                }
//            }
            switch ($i){
                case 0:
                    $reclaimedItem1=$reclaimedItem;
                    $sellerEtc1=$finalDisposalContent[$i]->SELLER_ETC;
                    break;
                case 1:
                    $reclaimedItem2=$reclaimedItem;
                    $sellerEtc2=$finalDisposalContent[$i]->SELLER_ETC;
                    break;
                case 2:
                    $reclaimedItem3=$reclaimedItem;
                    $sellerEtc3=$finalDisposalContent[$i]->SELLER_ETC;
                    break;
                case 3:
                    $reclaimedItem4=$reclaimedItem;
                    $sellerEtc4=$finalDisposalContent[$i]->SELLER_ETC;
                    break;
                case 4:
                    $reclaimedItem5=$reclaimedItem;
                    $sellerEtc5=$finalDisposalContent[$i]->SELLER_ETC;
                    break;
                case 5:
                    $reclaimedItem6=$reclaimedItem;
                    $sellerEtc6=$finalDisposalContent[$i]->SELLER_ETC;
                    break;
                case 6:
                    $reclaimedItem7=$reclaimedItem;
                    $sellerEtc7=$finalDisposalContent[$i]->SELLER_ETC;
                    break;
                case 7:
                    $reclaimedItem8=$reclaimedItem;
                    $sellerEtc8=$finalDisposalContent[$i]->SELLER_ETC;
                    break;
                case 8:
                    $reclaimedItem9=$reclaimedItem;
                    $sellerEtc9=$finalDisposalContent[$i]->SELLER_ETC;
                    break;
                case 9:
                    $reclaimedItem10=$reclaimedItem;
                    $sellerEtc10=$finalDisposalContent[$i]->SELLER_ETC;
                    break;
                case 10:
                    $reclaimedItem11=$reclaimedItem;
                    $sellerEtc11=$finalDisposalContent[$i]->SELLER_ETC;
                    break;
                case 11:
                    $reclaimedItem12=$reclaimedItem;
                    $sellerEtc12=$finalDisposalContent[$i]->SELLER_ETC;
                    break;
            }
        }
    }
    ?>
    <div class="tt1">別表４&nbsp;&nbsp;&nbsp;&nbsp;@if(!empty($table_title4))({{$table_title4}})@endif</div>
    <table cellpadding ="0" border="1px">
        <tr style="text-align: center;background-color: #cccccc" class="tb1">
            <td  colspan="14.5" align="center">丙での再生品目</td>
        </tr>
        <tr style="text-align: center"  align="center" valign="middle">
            <td colspan="2.5"><span>処分先No.<br/>（許可番号等）</span></td>
            <td colspan="3" class="tb2"><span>再生施設名称</span></td>
            <td colspan="3" class="tb2"><span>再生施設所在地</span></td>
            <td colspan="3" class="tb2"><span>処分方法</span></td>
            <td colspan="3" class="tb2"><span>処理能力</span></td>
        </tr>
        <tr style="text-align: center"  align="center" valign="middle" class="tb1">
            <td colspan="2.5" height="25px">{{$CwContract['processing_destination_No']}}</td>
            <td colspan="3">丙の施設</td>
            <td colspan="9">【委託業務の内容】記載の通り</td>
        </tr>
    </table>
    <table cellpadding ="5" border="1px">
        <tr style="text-align: center"  align="center" valign="middle" class="tb4">
            <td colspan="2.5">再生品目</td>
            <td colspan="2">{{$reclaimedItem1}}</td>
            <td colspan="2">{{$reclaimedItem2}}</td>
            <td colspan="2">{{$reclaimedItem3}}</td>
            <td colspan="2">{{$reclaimedItem4}}</td>
            <td colspan="2">{{$reclaimedItem5}}</td>
            <td colspan="2">{{$reclaimedItem6}}</td>
        </tr>
        <tr style="text-align: center"  align="center" valign="middle" class="tb4">
            <td colspan="2.5">売却先等</td>
            <td colspan="2">{{$sellerEtc1}}</td>
            <td colspan="2">{{$sellerEtc2}}</td>
            <td colspan="2">{{$sellerEtc3}}</td>
            <td colspan="2">{{$sellerEtc4}}</td>
            <td colspan="2">{{$sellerEtc5}}</td>
            <td colspan="2">{{$sellerEtc6}}</td>
        </tr>
        <tr style="text-align: center"  align="center" valign="middle" class="tb4">
            <td colspan="2.5">再生品目</td>
            <td colspan="2">{{$reclaimedItem7}}</td>
            <td colspan="2">{{$reclaimedItem8}}</td>
            <td colspan="2">{{$reclaimedItem9}}</td>
            <td colspan="2">{{$reclaimedItem10}}</td>
            <td colspan="2">{{$reclaimedItem11}}</td>
            <td colspan="2">{{$reclaimedItem12}}</td>
        </tr>
        <tr style="text-align: center"  align="center" valign="middle" class="tb4">
            <td colspan="2.5">売却先等</td>
            <td colspan="2">{{$sellerEtc7}}</td>
            <td colspan="2">{{$sellerEtc8}}</td>
            <td colspan="2">{{$sellerEtc9}}</td>
            <td colspan="2">{{$sellerEtc10}}</td>
            <td colspan="2">{{$sellerEtc11}}</td>
            <td colspan="2">{{$sellerEtc12}}</td>
        </tr>
    </table>
    <p></p>
    <?php
    $againLive1 = "□";
    $againLive2 = "□";
    $againLive = '';
    if(sizeof($FinalDisposalAgainLive) > 0) {
        if (!empty($FinalDisposalAgainLive[0]->Reclaimed_item_name)) {
            $againLive2 = "☑";
            $againLive = $FinalDisposalAgainLive[0]->Reclaimed_item_name;
        }
//        for ($i=0;$i<sizeof($FinalDisposalAgainLive);$i++) {
//            for ($y=0;$y<sizeof($masterData);$y++) {
//                if ($FinalDisposalAgainLive[$i]->Waste_type_K == $masterData[$y]['master_id']) {
//                    $FinalDisposalAgainLive[$i]->Waste_type_K = $masterData[$y]['master_data'];
//                }
//            }
//        }
        for ($i=0;$i<sizeof($FinalDisposalAgainLive);$i++) {
            if (!empty($FinalDisposalAgainLive[$i]->Waste_type) || !empty($FinalDisposalAgainLive[$i]->Disposal_destination_No) ||
                !empty($FinalDisposalAgainLive[$i]->Facility_name) || !empty($FinalDisposalAgainLive[$i]->Facility_location) ||
                !empty($FinalDisposalAgainLive[$i]->Regeneration_Disposal_method) || !empty($FinalDisposalAgainLive[$i]->processing_power) ||
                !empty($FinalDisposalAgainLive[$i]->Remarks)) {
                $againLive1 = "☑";
            }
        }
    }
    ?>
    <div class="tt1">別表５&nbsp;&nbsp;&nbsp;&nbsp;@if(!empty($table_title5))({{$table_title5}})@endif</div>
    <table cellspacing="0" border="1">
        <tr style="text-align: center;background-color: #cccccc" class="tb1">
            <td  colspan="7" align="center">丙からの再生（委託）先({{$againLive1}}以下の通り ・ {{$againLive2}} 別添（{{$againLive}}）の通り）</td>
        </tr>
        <tr style="text-align: center"  align="center" valign="middle">
            <td><span>廃棄物の<br/>種類</span></td>
            <td><span>処分先No.<br/>（許可番号等）</span></td>
            <td><span>再生<br/>施設名称</span></td>
            <td class="tb2"><span>再生施設所在地</span></td>
            <td class="tb2"><span>処分方法</span></td>
            <td class="tb2"><span>処理能力</span></td>
            <td><span>備考<br/>（利用方法等）</span></td>
        </tr>
    </table>
    <table cellspacing="0" border="1" cellpadding="5px">
        <?php for($i=0;$i<sizeof($FinalDisposalAgainLive);$i++):?>
        <tr style="text-align: center"  align="center" valign="middle" class="tb4">
            <td height="25px">{{$FinalDisposalAgainLive[$i]->Waste_type}}</td>
            <td>{{$FinalDisposalAgainLive[$i]->Disposal_destination_No}}</td>
            <td>{{$FinalDisposalAgainLive[$i]->Facility_name}}</td>
            <td>{{$FinalDisposalAgainLive[$i]->Facility_location}}</td>
            <td>{{$FinalDisposalAgainLive[$i]->Regeneration_Disposal_method}}</td>
            <td>{{$FinalDisposalAgainLive[$i]->processing_power}}</td>
            <td>{{$FinalDisposalAgainLive[$i]->Remarks}}</td>
        </tr>
        <?php endfor;?>
        <?php for($i=0;$i<15-sizeof($FinalDisposalAgainLive);$i++):?>
        <tr style="text-align: center"  align="center" valign="middle" class="tb1">
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
        </tr>
        <?php endfor;?>
    </table>
    <br pagebreak="true" />
    <?php
    $final1 = "□";
    $final2 = "□";
    $final = '';
    if(sizeof($FinalDisposalFinal) > 0) {
        if (!empty($FinalDisposalFinal[0]->Reclaimed_item_name)) {
            $final = $FinalDisposalFinal[0]->Reclaimed_item_name;
            $final2 = "☑";
        }
//        for ($i=0;$i<sizeof($FinalDisposalFinal);$i++) {
//            for ($y=0;$y<sizeof($masterData);$y++) {
//                if ($FinalDisposalFinal[$i]->Waste_type_K == $masterData[$y]['master_id']) {
//                    $FinalDisposalFinal[$i]->Waste_type_K = $masterData[$y]['master_data'];
//                }
//            }
//        }
        for ($i=0;$i<sizeof($FinalDisposalFinal);$i++) {
            if (!empty($FinalDisposalFinal[$i]->Waste_type) || !empty($FinalDisposalFinal[$i]->Disposal_destination_No) ||
                !empty($FinalDisposalFinal[$i]->Facility_name) || !empty($FinalDisposalFinal[$i]->Facility_location) ||
                !empty($FinalDisposalFinal[$i]->processing_power) || !empty($FinalDisposalFinal[$i]->Remarks)) {
                $final1 = "☑";
            }
        }
    }
    ?>
    <table cellspacing="0" border="1" align="center" style="color: black">
        <tr style="text-align: center;background-color: #cccccc" class="tb1">
            <td  colspan="7" align="center">丙からの最終処分（委託）先({{$final1}} 以下の通り ・ {{$final2}} 別添({{$final}}）の通り)</td>
        </tr>
        <tr align="center">
            <td>廃棄物の<br/>種類</td>
            <td>処分先No.<br/>（許可番号等）</td>
            <td>最終処分<br/>施設名称</td>
            <td>最終処分施設所在地</td>
            <td class="tb2">処分方法</td>
            <td class="tb2">処理能力</td>
            <td class="tb2">備考</td>
        </tr>
    </table>
    <table cellspacing="0" border="1" cellpadding="5px">
        <?php for($i=0;$i<sizeof($FinalDisposalFinal);$i++):?>
        <?php
        $lastDisposalMethod = '';
        if($FinalDisposalFinal[$i]->Last_Disposal_method == 0)
            $lastDisposalMethod = '安';
        elseif ($FinalDisposalFinal[$i]->Last_Disposal_method == 1)
            $lastDisposalMethod = '管';
        elseif ($FinalDisposalFinal[$i]->Last_Disposal_method == 2)
            $lastDisposalMethod = '遮';
        ?>
        <tr style="text-align: center"  align="center" valign="middle" class="tb4">
            <td height="25px">{{$FinalDisposalFinal[$i]->Waste_type}}</td>
            <td>{{$FinalDisposalFinal[$i]->Disposal_destination_No}}</td>
            <td>{{$FinalDisposalFinal[$i]->Facility_name}}</td>
            <td>{{$FinalDisposalFinal[$i]->Facility_location}}</td>
            <td>{{$lastDisposalMethod}}</td>
            <td>{{$FinalDisposalFinal[$i]->processing_power}}<?php echo ($FinalDisposalFinal[$i]->processing_power == '' || $FinalDisposalFinal[$i]->processing_power == null) ? '' : '㎥' ?></td>
            <td>{{$FinalDisposalFinal[$i]->Remarks}}</td>
        </tr>
        <?php endfor;?>
        <?php for($i=0;$i<8-sizeof($FinalDisposalFinal);$i++):?>
        <tr style="text-align: center"  align="center" valign="middle" class="tb1">
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td></td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td></td>
        </tr>
        <?php endfor;?>
    </table>
    <p></p>
    <?php
    $middle1 = "□";
    $middle2 = "□";
    $middle = '';
    if(sizeof($FinalDisposalMiddle) > 0) {
        if (!empty($FinalDisposalMiddle[0]->Reclaimed_item_name)) {
            $middle = $FinalDisposalMiddle[0]->Reclaimed_item_name;
            $middle2 = "☑";
        }
//        for ($i=0;$i<sizeof($FinalDisposalMiddle);$i++) {
//            for ($y=0;$y<sizeof($masterData);$y++) {
//                if ($FinalDisposalMiddle[$i]->Waste_type_K == $masterData[$y]['master_id']) {
//                    $FinalDisposalMiddle[$i]->Waste_type_K = $masterData[$y]['master_data'];
//                }
//            }
//        }
        for ($i=0;$i<sizeof($FinalDisposalMiddle);$i++) {
            if (!empty($FinalDisposalMiddle[$i]->Waste_type) || !empty($FinalDisposalMiddle[$i]->Disposal_destination_No) ||
                !empty($FinalDisposalMiddle[$i]->Facility_name) || !empty($FinalDisposalMiddle[$i]->Facility_location) ||
                !empty($FinalDisposalMiddle[$i]->Reintermediate_processing_Disposal_method) || !empty($FinalDisposalMiddle[$i]->processing_power) ||
                !empty($FinalDisposalMiddle[$i]->Waste_after_treatment) || !empty($FinalDisposalMiddle[$i]->Reintermediate_processing)) {
                $middle1 = "☑";
            }
        }
    }
    ?>
    <table cellspacing="0" border="1" align="center">
        <tr style="text-align: center;background-color: #cccccc" class="tb1">
            <td  colspan="8" align="center">丙からの再中間処理（{{$middle1}}以下の通り・{{$middle2}} 別添({{$middle}}）の通り)</td>
        </tr>
        <tr align="center">
            <td>中間・最<br/>終の区分</td>
            <td>廃棄物の.<br/>種類</td>
            <td>処分先No<br/>(許可番号等)</td>
            <td class="tb2">施設名称</td>
            <td class="tb2">施設所在地</td>
            <td class="tb2">処分方法</td>
            <td class="tb2">処理能力</td>
            <td>処理後の廃棄物</td>
        </tr>
    </table>
    <table cellspacing="0" border="1" cellpadding="5px">
        <?php for($i=0;$i<sizeof($FinalDisposalMiddle);$i++):?>
        <tr style="text-align: center"  align="center" valign="middle" class="tb4">
            <td height="25px">{{$FinalDisposalMiddle[$i]->Reintermediate_processing}}</td>
            <td>{{$FinalDisposalMiddle[$i]->Waste_type}}</td>
            <td>{{$FinalDisposalMiddle[$i]->Disposal_destination_No}}</td>
            <td>{{$FinalDisposalMiddle[$i]->Facility_name}}</td>
            <td>{{$FinalDisposalMiddle[$i]->Facility_location}}</td>
            <td>{{$FinalDisposalMiddle[$i]->Reintermediate_processing_Disposal_method}}</td>
            <td>{{$FinalDisposalMiddle[$i]->processing_power}}</td>
            <td>{{$FinalDisposalMiddle[$i]->Waste_after_treatment}}</td>
        </tr>
        <?php endfor;?>
        <?php for($i=0;$i<6-sizeof($FinalDisposalMiddle);$i++):?>
        <tr style="text-align: center"  align="center" valign="middle" class="tb1">
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
        </tr>
        <?php endfor;?>
    </table>
    <br pagebreak="true" />
    <div class="tt1">別表６&nbsp;&nbsp;&nbsp;&nbsp;@if(!empty($table_title6))({{$table_title6}})@endif</div>
    <table border="1px"  cellpadding="6px">
        <tr style="text-align: center;background-color: #cccccc">
            <td  colspan="6" align="center">収集運搬会社</td>
        </tr>
        <tr align="center">
            <td rowspan="2"><div style="height: 5px"></div><span>会 社 名</span></td>
            <td rowspan="2"><div style="height: 5px"></div><span>住 所</span></td>
            <td colspan="2">許可番号</td>
            <td colspan="2">許可内容</td>
        </tr>
        <tr align="center">
            <td>排出場所</td>
            <td>処分場所</td>
            <td>品目(種類)</td>
            <td>車両台数</td>
        </tr>
        <?php for($i=0;$i<sizeof($CarrierCompany);$i++) :?>
        <tr style="text-align: center"  align="center" valign="middle" class="tb4">
            <td>{{$CarrierCompany[$i]['company_name']}}</td>
            <td>{{$CarrierCompany[$i]['street_address']}}</td>
            <td>{{$CarrierCompany[$i]['discharge_location']}}</td>
            <td>{{$CarrierCompany[$i]['disposal_place']}}</td>
            <td>{{$CarrierCompany[$i]['construction_Item']}}</td>
            <td>{{$CarrierCompany[$i]['Number_vehicles']}}</td>
        </tr>
        <?php endfor;?>
        <?php for($i=0;$i<5-sizeof($CarrierCompany);$i++) :?>
        <tr style="text-align: center"  align="center" valign="middle" class="tb1">
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
        </tr>
        <?php endfor;?>
    </table>
@endif
</html>

